Optimal. Leaf size=137 \[ \frac{d (c+d x)}{2 f^2 (a+i a \cot (e+f x))}-\frac{i (c+d x)^2}{2 f (a+i a \cot (e+f x))}+\frac{i (c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}+\frac{i d^2}{4 f^3 (a+i a \cot (e+f x))}-\frac{d^2 x}{4 a f^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.122501, antiderivative size = 137, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3723, 3479, 8} \[ \frac{d (c+d x)}{2 f^2 (a+i a \cot (e+f x))}-\frac{i (c+d x)^2}{2 f (a+i a \cot (e+f x))}+\frac{i (c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}+\frac{i d^2}{4 f^3 (a+i a \cot (e+f x))}-\frac{d^2 x}{4 a f^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3723
Rule 3479
Rule 8
Rubi steps
\begin{align*} \int \frac{(c+d x)^2}{a+i a \cot (e+f x)} \, dx &=\frac{(c+d x)^3}{6 a d}-\frac{i (c+d x)^2}{2 f (a+i a \cot (e+f x))}+\frac{(i d) \int \frac{c+d x}{a+i a \cot (e+f x)} \, dx}{f}\\ &=\frac{i (c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}+\frac{d (c+d x)}{2 f^2 (a+i a \cot (e+f x))}-\frac{i (c+d x)^2}{2 f (a+i a \cot (e+f x))}-\frac{d^2 \int \frac{1}{a+i a \cot (e+f x)} \, dx}{2 f^2}\\ &=\frac{i (c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}+\frac{i d^2}{4 f^3 (a+i a \cot (e+f x))}+\frac{d (c+d x)}{2 f^2 (a+i a \cot (e+f x))}-\frac{i (c+d x)^2}{2 f (a+i a \cot (e+f x))}-\frac{d^2 \int 1 \, dx}{4 a f^2}\\ &=-\frac{d^2 x}{4 a f^2}+\frac{i (c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}+\frac{i d^2}{4 f^3 (a+i a \cot (e+f x))}+\frac{d (c+d x)}{2 f^2 (a+i a \cot (e+f x))}-\frac{i (c+d x)^2}{2 f (a+i a \cot (e+f x))}\\ \end{align*}
Mathematica [A] time = 0.330341, size = 149, normalized size = 1.09 \[ \frac{4 f^3 x \left (3 c^2+3 c d x+d^2 x^2\right )+3 (\cos (2 e)+i \sin (2 e)) \cos (2 f x) ((1+i) c f+d (-1+(1+i) f x)) ((1+i) c f+d ((1+i) f x+i))+3 i (\cos (2 e)+i \sin (2 e)) \sin (2 f x) ((1+i) c f+d (-1+(1+i) f x)) ((1+i) c f+d ((1+i) f x+i))}{24 a f^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.178, size = 108, normalized size = 0.8 \begin{align*}{\frac{{d}^{2}{x}^{3}}{6\,a}}+{\frac{cd{x}^{2}}{2\,a}}+{\frac{{c}^{2}x}{2\,a}}+{\frac{{c}^{3}}{6\,ad}}+{\frac{{\frac{i}{8}} \left ( 2\,{d}^{2}{x}^{2}{f}^{2}+2\,i{d}^{2}fx+4\,cd{f}^{2}x+2\,icdf+2\,{c}^{2}{f}^{2}-{d}^{2} \right ){{\rm e}^{2\,i \left ( fx+e \right ) }}}{a{f}^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.64781, size = 223, normalized size = 1.63 \begin{align*} \frac{4 \, d^{2} f^{3} x^{3} + 12 \, c d f^{3} x^{2} + 12 \, c^{2} f^{3} x +{\left (6 i \, d^{2} f^{2} x^{2} + 6 i \, c^{2} f^{2} - 6 \, c d f - 3 i \, d^{2} +{\left (12 i \, c d f^{2} - 6 \, d^{2} f\right )} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}}{24 \, a f^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.50811, size = 226, normalized size = 1.65 \begin{align*} \begin{cases} \frac{\left (2 i a^{2} c^{2} f^{5} e^{2 i e} + 4 i a^{2} c d f^{5} x e^{2 i e} - 2 a^{2} c d f^{4} e^{2 i e} + 2 i a^{2} d^{2} f^{5} x^{2} e^{2 i e} - 2 a^{2} d^{2} f^{4} x e^{2 i e} - i a^{2} d^{2} f^{3} e^{2 i e}\right ) e^{2 i f x}}{8 a^{3} f^{6}} & \text{for}\: 8 a^{3} f^{6} \neq 0 \\- \frac{c^{2} x e^{2 i e}}{2 a} - \frac{c d x^{2} e^{2 i e}}{2 a} - \frac{d^{2} x^{3} e^{2 i e}}{6 a} & \text{otherwise} \end{cases} + \frac{c^{2} x}{2 a} + \frac{c d x^{2}}{2 a} + \frac{d^{2} x^{3}}{6 a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22021, size = 193, normalized size = 1.41 \begin{align*} \frac{4 \, d^{2} f^{3} x^{3} + 12 \, c d f^{3} x^{2} + 6 i \, d^{2} f^{2} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c^{2} f^{3} x + 12 i \, c d f^{2} x e^{\left (2 i \, f x + 2 i \, e\right )} + 6 i \, c^{2} f^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 6 \, d^{2} f x e^{\left (2 i \, f x + 2 i \, e\right )} - 6 \, c d f e^{\left (2 i \, f x + 2 i \, e\right )} - 3 i \, d^{2} e^{\left (2 i \, f x + 2 i \, e\right )}}{24 \, a f^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]